/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package EntityClass;

import java.io.Serializable;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToOne;

/**
 *
 * @author Ben
 */
@Entity(name="PatientBi")
public class Patient implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    private Long id;
    private String name;
    private int age;
    private String address;
    @OneToOne(cascade={CascadeType.PERSIST})
    private MPI mpi;
    
    public Patient(){}
    public void create(Long id, String name, int age, String address){
        this.setId(id);
        this.setName(name);
        this.setAge(age);
        this.setAddress(address);
    }

    public MPI getMPI(){
        return mpi;
    }
    public void setMPI(MPI mpi){
        this.mpi=mpi;       
    }
    
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

   public String getName(){
       return name;
   }
   
   public void setName(String name){
       this.name=name;
   }
   public int getAge(){
       return age;
   }
   
   public void setAge(int age){
       this.age=age;
       
   }
   
   public String getAddress(){
       return address;
   }
   public void setAddress(String address){
       this.address=address;
   }
   
}
